// cfg_dlg.cpp : implementation file
//

#include "stdafx.h"
#include "IEC104_Tool.h"
#include "cfg_dlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// Ccfg_dlg dialog


Ccfg_dlg::Ccfg_dlg(CWnd* pParent /*=NULL*/)
	: CDialog(Ccfg_dlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(Ccfg_dlg)
	m_DevAddr = 1;
	m_Sector = 1;
	//}}AFX_DATA_INIT
}


void Ccfg_dlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(Ccfg_dlg)
	DDX_Control(pDX, IDC_COMBO_CMD, m_Cmd_Sel);
	DDX_Text(pDX, IDC_EDIT_ADDR, m_DevAddr);
	DDX_Text(pDX, IDC_EDIT_SECT, m_Sector);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(Ccfg_dlg, CDialog)
	//{{AFX_MSG_MAP(Ccfg_dlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// Ccfg_dlg message handlers

BOOL Ccfg_dlg::OnInitDialog() 
{
	CDialog::OnInitDialog();	
	// TODO: Add extra initialization here
	m_Cmd_Sel.SetCurSel(0);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void Ccfg_dlg::OnOK() 
{
	// TODO: Add extra validation here
	m_Cur_Select = m_Cmd_Sel.GetCurSel();
	CDialog::OnOK();
}
